import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    islogin: sessionStorage.getItem('islogin'),
    name: sessionStorage.getItem('name'),
    user_id: sessionStorage.getItem('user_id'),
  },
  mutations: {
    loginOK(state, newName, newId) {
      state.islogin = true
      state.name = newName
      state.newId = newId
    }
  },
  actions: {
  },
  modules: {
  }
})
